<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
    <form action="{:U("doTopup")}" method="post" target="_blank" id="trade">
        <div>
            <label for="uid">用户ID：</label>
            <input type="text" name="uid" id="uid" value="0">
        </div>

        <div>
            <label for="money">充值金额：</label>
            <input type="text" name="money" id="money" value="1">
        </div>

        <div>
            <input type="hidden" name="tradeName" value="topup">
            <input type="submit" value="充值">
            <button type="button" onclick="getSignature()">生成签名</button>
        </div>

    </form>
    <pre id="result"></pre>
    <script>
        function getSignature(){
            $.post('{:U("Pay/recharge")}',$("#trade").serialize(),function(data){
                $("#result").text(JSON.stringify(data));
            })
        }
    </script>
</body>
</html>

